package org.hrds.rdupm.harbor.infra.feign.fallback;

import java.util.List;
import java.util.Set;

import io.choerodon.core.exception.CommonException;

import org.hrds.rdupm.harbor.api.vo.ExternalTenantVO;
import org.hrds.rdupm.harbor.infra.feign.BaseFeignClient;
import org.hrds.rdupm.harbor.infra.feign.dto.ProjectDTO;
import org.hrds.rdupm.harbor.infra.feign.dto.UserDTO;
import org.hrds.rdupm.harbor.infra.feign.dto.UserWithGitlabIdDTO;
import org.hrds.rdupm.util.ExceptionConstants;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

/**
 * BaseFeignClientFallBack
 *
 * @author chenxiuhong
 */
@Component
public class BaseFeignClientFallBack implements BaseFeignClient {

    @Override
    public ResponseEntity<List<UserDTO>> listUsersByName(Long prjectId, String param) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_USER_SELECTUSERBYPROJECTID);
    }

    @Override
    public ResponseEntity<ProjectDTO> query(Long id) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_PROJECT_SELECT);
    }

    @Override
    public ResponseEntity<List<ProjectDTO>> queryByIds(Set<Long> ids) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_PROJECT_SELECT);
    }

    @Override
    public ResponseEntity<List<UserWithGitlabIdDTO>> listUsersWithRolesAndGitlabUserIdByIds(Long projectId, Set<Long> userIds) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_USER_BATCH_SELECT);
    }

    @Override
    public ResponseEntity<List<UserDTO>> listProjectOwnerById(Long projectId) {
        return null;
    }

    @Override
    public ResponseEntity<List<ExternalTenantVO>> querySaasTenants(List<String> saasLevels) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_SAAS_TENANT_SELECT);
    }

    @Override
    public ResponseEntity<List<ProjectDTO>> queryProjectByOrgId(Long organizationId) {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_PROJECT_BY_ORGID);
    }

    @Override
    public ResponseEntity<List<ExternalTenantVO>> queryRegisterTenant() {
        throw new CommonException(ExceptionConstants.FeignCode.RDUPM_FEIGN_REGISTER_TENANT);
    }
}
